package com.zyf.workflow.node;

import com.zyf.workflow.node.bean.NodeResultBean;
import com.zyf.workflow.business.osinstall.OSInstallWorker;
import com.zyf.workflow.worker.Worker;
import com.zyf.workflow.business.osinstall.bean.OSBean;
import com.zyf.workflow.worker.bean.WorkerResultBean;

public class WorkNodeTest {


    public void test() {

        OSBean osBean = new OSBean();
        osBean.setFileName("centos7.iso");
        osBean.setFilePath("/opt/iso/");
        OSInstallWorker osInstallWorker = new OSInstallWorker();

//        Worker<OSBean> worker = osInstallWorker::install;

//        WorkNode<OSBean, NodeResultBean> workNode1 = new WorkNode(1, osBean, worker, "osInstallNode", new OsInstallCallBack(), "noop");

//        WorkNode<OSBean, NodeResultBean> workNode2= new WorkNode.Builder<OSBean,NodeResultBean>()
////                .withWorker(worker)
//                .withNodeId(2)
//                .withData(osBean)
//                .withName("osInstallNode")
//                .setCallBack(new OsInstallCallBack())
//                .withType("noop")
//                .create();
//        NodeResultBean resultBean = workNode1.doWork();
//        NodeResultBean resultBean1 = workNode2.doWork();
//        System.out.println(resultBean);
//        System.out.println(resultBean1);

    }

    public static void main(String[] args) {
        WorkNodeTest test = new WorkNodeTest();
        test.test();
    }
}
